<!doctype html>
<html >
<head>
    
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <!--[if lt IE 9]>
                <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
        <![endif]-->
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />

  <link rel="stylesheet" type="text/css" href="template.css" />

   <link href="https://vjs.zencdn.net/5.4.4/video-js.css" rel="stylesheet" />



<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type='text/javascript' src='menu/js/jquery.cookie.js'></script>
<script type='text/javascript' src='menu/js/jquery.hoverIntent.minified.js'></script>
<script type='text/javascript' src='menu/js/jquery.dcjqaccordion.2.7.min.js'></script>

<link href="menu/css/skins/blue.css" rel="stylesheet" type="text/css" />
<link href="menu/css/skins/graphite.css" rel="stylesheet" type="text/css" />
<link href="menu/css/skins/grey.css" rel="stylesheet" type="text/css" />
  
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
        
  
  <script src="script.js"></script>
  
    <script src="jquery.sticky-kit.js "></script>
  <meta name="generator" content="pandoc" />
  <meta name="author" content="Johannes Karreth" />
  <title></title>
  <style type="text/css">code{white-space: pre;}</style>
  <link rel="stylesheet" href="template.css" type="text/css" />
</head>
<body>

    
    <div class="navbar navbar-static-top">
    <div class="navbar-inner">
      <div class="container">
        <span class="doc-title">Replication package for &quot;The Economic Leverage of International Organizations in Interstate Disputes&quot;</span>
        <ul class="nav pull-right doc-info">
                    <li><p class="navbar-text">Johannes Karreth</p></li>
                              <li><p class="navbar-text">August 3, 2017</p></li>
                  </ul>
      </div>
    </div>
  </div>
    <div class="container">
    <div class="row">
            <div id="TOC" class="span3">
        <div class="well toc">

        <ul>
        <li><a href="#overview">Overview</a></li>
        <li><a href="#data-sources">Data sources</a></li>
        <li><a href="#instructions">Instructions</a><ul>
        <li><a href="#analyses-of-claims">1. Analyses of claims</a></li>
        <li><a href="#analyses-of-crises">2. Analyses of crises</a></li>
        <li><a href="#other-analyses">3. Other analyses</a></li>
        <li><a href="#descriptive-information">4. Descriptive information</a></li>
        </ul></li>
        <li><a href="#list-of-files">List of files</a></li>
        <li><a href="#software-information">Software information</a></li>
        </ul>

        </div>
      </div>
            <div class="span9">
            <!-- pandoc 0_readme.txt -o 0_readme.html -f markdown --template standalone.html --css template.css --toc --toc-depth=2 -->
<h1 id="overview">Overview</h1>
<p>This folder contains all data and code to reproduce the analyses in &quot;The Economic Leverage of International Organizations in Interstate Disputes&quot; (forthcoming in International Interactions). This document makes reference to the supporting information (SI), which is part of this replication package and also posted at <a href="http://www.jkarreth.net" class="uri">http://www.jkarreth.net</a>. For any questions, please contact the author at <script type="text/javascript">
<!--
h='&#x75;&#114;&#x73;&#x69;&#110;&#x75;&#x73;&#46;&#x65;&#100;&#x75;';a='&#64;';n='&#106;&#x6b;&#x61;&#114;&#114;&#x65;&#116;&#104;';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+e+'<\/'+'a'+'>');
// -->
</script><noscript>&#106;&#x6b;&#x61;&#114;&#114;&#x65;&#116;&#104;&#32;&#x61;&#116;&#32;&#x75;&#114;&#x73;&#x69;&#110;&#x75;&#x73;&#32;&#100;&#x6f;&#116;&#32;&#x65;&#100;&#x75;</noscript>.</p>
<p>At the top level, this folder contains all R scripts necessary to:</p>
<ul>
<li>compile the data for analysis</li>
<li>read the data into R and recode some variables for analysis</li>
<li>conduct the analyses in the article</li>
</ul>
<p>All tables and figures produced by these scripts are written to the <code>Output_Tables-and-Figures</code> folder. Full posterior distributions for all quantities estimated using MCMC are written to the <code>Output_MCMC</code> folder.</p>
<p>All raw datasets needed to create the data for analyses are provided in the <code>Sources</code> folder.</p>
<p>The <code>Functions</code> folder contains custom R functions used in this project. Where applicable, credits for code obtained from other researchers are noted at the beginning of each function.</p>
<p>All analyses using R were executed on R version 3.3.2 (2016-10-31) on OS X El Capitan 10.11.6; a list of packages and versions used is at the end of this file. Analyses using Stata were executed on Stata/SE 13.1 for Mac (64-bit Intel), Revision 16 Dec 2016.</p>
<h3 id="note-on-reproducing-exact-numerical-results">Note on reproducing exact numerical results</h3>
<p>Most statistical analyses for this article use Bayesian estimation using Stan (via the <code>rstan</code> package in R). According to the Stan development team, different installations of Stan will produce (slightly) different draws, even if the same seed is used. This is documented in the Stan users mailing list <a href="https://groups.google.com/d/topic/stan-users/qsrsvRgYOJk/discussion">here</a> (archived <a href="http://www.jkarreth.net/files/Stan_Differences.pdf">here</a>). Therefore, unless you use the same operating system, version of R, and version of rstan as I used to produce these results (see the end of this file), you may obtain slightly different estimation results. These will likely show up only in postestimation quantities (e.g. first differences) and produce only minor differences. However, all estimated quantities (posterior distributions) are provided in this replication package (in the <code>Output_MCMC</code> folder) so that the numbers shown in all figures and tables can be reproduced exactly. To this end, instead of generating a model object from scratch, read the relevant object into R and execute the subsequent code. For example, in the script <code>12_claims_figure.R</code>: Instead of generating and saving <code>m1_stanglm</code> (in lines 34-42), load the stored object using this line of code:</p>
<pre><code>m1_stanglm &lt;- readRDS(file = &quot;Output_MCMC/claims_m1_stanglm.RDS&quot;)</code></pre>
<p>and then execute the rest of the script as is.</p>
<h3 id="note-on-computation-time">Note on computation time</h3>
<p>Fitting some of the models using Bayesian estimation may take a considerable amount of time, depending on hardware specification. However, all estimated quantities (posterior distributions) are provided in this replication package (in the <code>Output_MCMC</code> folder) so that figures and tables can be reproduced without fitting each model from scratch. The section immediately above describes how to read these posterior distributions into R.</p>
<h1 id="data-sources">Data sources</h1>
<p>All data sources are documented in the SI (Table A2). The data in the &quot;Sources&quot; folder are either directly downloaded from their source or restructured/combined to fit the units of analysis in this project as described below:</p>
<ul>
<li><code>atop3_0ddyr.dta</code>: ATOP data version 3.0</li>
<li><code>Dyadicdata.tab</code>: United Nations General Assembly Voting Data Version 17.0</li>
<li><code>icb1v11.csv</code>: International Crisis Behavior Data, crisis level</li>
<li><code>icbdy_v11.csv</code>: International Crisis Behavior Data, dyad level</li>
<li><code>ICOWclaimdy.dta</code>: ICOW Dyadic Claim-Level Summary Data</li>
<li><code>IGO_igounit_v2.3.narrow.csv</code>: COW IGO data, IGO level</li>
<li><code>IGO_igounit_v2.3.short.csv</code>: COW IGO data, IGO level</li>
<li><code>IGO_names_v2.3.csv</code>: COW IGO data, IGO names</li>
<li><code>IGO_stateunit_v2.3.csv</code>: COW IGO data, state level</li>
<li><code>igo.c1.diss.dta</code>: IGO memberships from COW, monadic level, generated by Johannes Karreth</li>
<li><code>igo.c2.diss.dta</code>: IGO memberships from COW, monadic level, generated by Johannes Karreth</li>
<li><code>igo.dyad.diss.dta</code>: IGO memberships from COW, dyadic level, generated by Johannes Karreth</li>
<li><code>IGOpb_dyadunit.dta</code>: Peace-brokering IGOs, coded from Shannon (2009)</li>
<li><code>igotrade.ud1918.dta</code>: IGO and trade data (Gleditsch 2002), undirected dyads</li>
<li><code>KGD_rivalry_yearly.dta</code>: Klein, Goertz &amp; Diehl rivalry data</li>
<li><code>mtopsd150.dta</code>: Multilateral Treaties of Pacific Settlement (MTOPS) Data Set Version 1.4</li>
<li><code>NMC_v4_0.c1.dta</code>: COW National Material Capabilities Data Version 4.0, monadic</li>
<li><code>NMC_v4_0.c2.dta</code>: COW National Material Capabilities Data Version 4.0, monadic</li>
<li><code>polityiv.c1.dta</code>: Polity IV data, monadic</li>
<li><code>polityiv.c2.dta</code>: Polity IV data, monadic</li>
<li><code>thompson.rivalry.yearly.dta</code>: Thompson &amp; Dreyer rivalry data</li>
<li><code>TM_WORLD_BORDERS_SIMPL-0.3</code>: Shape file for world map provided by Bjorn Sandvik, <a href="http://www.thematicmapping.org" class="uri">http://www.thematicmapping.org</a></li>
</ul>
<h1 id="instructions">Instructions</h1>
<h2 id="analyses-of-claims">1. Analyses of claims</h2>
<p>To prepare the data for analysis, <code>claims_full.csv</code>:</p>
<ul>
<li>Execute <code>10_claims_createdata.R</code></li>
<li>Note: This step is not necessary because <code>claims_full.csv</code> is already part of the replication package. The code is provided to document the creation of the data used in the analyses.</li>
</ul>
<p>To reproduce the analysis underlying Figure 1 only:</p>
<ul>
<li>Execute <code>11_claims_readdata.R</code></li>
<li>Execute <code>12_claims_figure1.R</code></li>
</ul>
<p>To reproduce all other analyses of claims shown in the SI (sections 11 and 12):</p>
<ul>
<li>Execute <code>11_claims_readdata.R</code></li>
<li>Execute <code>13_claims_analyses.R</code></li>
<li>For section 11.5, execute <code>14_claims_dy_analyses.R</code></li>
<li>For section 11.6, execute <code>15_claims_selection.do</code></li>
</ul>
<h2 id="analyses-of-crises">2. Analyses of crises</h2>
<p>To prepare the data for analysis, <code>crises_full.csv</code>:</p>
<ul>
<li>Execute <code>20_crises_createdata.R</code></li>
<li>Note: This step is not necessary because <code>crises_full.csv</code> is already part of the replication package. The code is provided to document the creation of the data used in the analyses.</li>
</ul>
<p>To reproduce the analysis underlying Figure 1 only:</p>
<ul>
<li>Execute <code>21_crises_readdata.R</code></li>
<li>Execute <code>22_crises_figure2.R</code></li>
</ul>
<p>To reproduce all other analyses of claims shown in the SI (sections 13 and 14):</p>
<ul>
<li>Execute <code>21_crises_readdata.R</code></li>
<li>Execute <code>23_crises_analyses.R</code></li>
<li>For section 13.4, execute <code>24_crises_coll_analyses.R</code></li>
</ul>
<h2 id="other-analyses">3. Other analyses</h2>
<p>To reproduce the figures in Section 10 of the SI:</p>
<ul>
<li>Execute <code>30_claims-crises_coefficients.R</code></li>
</ul>
<p>To reproduce the analyses in Section 15 of the SI:</p>
<ul>
<li>Execute <code>40_hligo_joint.R</code></li>
</ul>
<h2 id="descriptive-information">4. Descriptive information</h2>
<p>To reproduce the figures in Section 4 of the SI:</p>
<ul>
<li>Execute <code>11_claims_readdata.R</code> and <code>21_crises_readdata.R</code></li>
</ul>
<p>To reproduce the figures in Section 5 of the SI:</p>
<ul>
<li>Execute <code>13_claims_analyses.R</code> and <code>23_crises_analyses.R</code></li>
</ul>
<p>To reproduce the figures in Section 6 of the SI:</p>
<ul>
<li>Execute <code>50_hligo_geo.R</code></li>
</ul>
<h1 id="list-of-files">List of files</h1>
<p>The list below shows the complete file structure of this replication package. Note that the folders within the package (<code>Functions</code>, <code>Output_MCMC</code>, <code>Output_Tables-and-Figures</code>, <code>Sources</code>) are compressed in .zip format. These folders need to be extracted before proceeding.</p>
<ul>
<li>On Mac OS X, open the Terminal, change to the <code>Replication</code> directory, and type <code>unzip Functions.zip</code> etc.</li>
<li>On Windows, use an application such as <a href="http://www.7-zip.org">7-Zip</a> to extract these folders.</li>
</ul>
<pre><code>Replication
|- 10_claims_createdata.R
|- 11_claims_readdata.R
|- 13_claims_analyses.R
|- 14_claims_dy_analyses.R
|- 15_claims_selection.do
|- 20_crises_createdata.R
|- 21_crises_readdata.R
|- 23_crises_analyses.R
|- 24_crises_coll_analyses.R
|- 30_claims-crises_coefficients.R
|- 40_hligo_joint.R
|- 50_hligo_geo.R
|- 60_hligo_time.R
|- claims_dyadyear.csv
|- claims_full.csv
|- claims_full.dta
|- claims_m-allothers_roc.stan
|- claims_m-ingr23_roc.stan
|- claims_m-mp3_roc.stan
|- claims_m-noigos_roc.stan
|- claims_m-pb_roc.stan
|- claims_m1_roc.stan
|- claims_m1.stan
|- claims_selection.csv
|- crises_full.csv
|- crises_full.dta
|- crises_m-allothers_roc.stan
|- crises_m-ingr23_roc.stan
|- crises_m-mp3_roc.stan
|- crises_m-noigos_roc.stan
|- crises_m-pb_roc.stan
|- crises_m1_roc.stan
|- Functions/
|  |- geom_flat_violin.R
|  |- MCMC_roc_prc.R
|  |- MCMClogit.fd.mat.R
|  |- plotBMA.R
|  |- theme_jk.R
|- hl-igo_dyad.dta
|- hligo_joint.csv
|- igo_overlap_num.csv
|- Output_MCMC/
|  |- claims_dy_m1.RDS
|  |- claims_dy_m2.RDS
|  |- claims_m1_allothers_rstan.RDS
|  |- claims_m1_ingr23_rstan.RDS
|  |- claims_m1_mp3_rstan.RDS
|  |- claims_m1_noigo_stanglm.RDS
|  |- claims_m1_noigos_rstan.RDS
|  |- claims_m1_pb_rstan.RDS
|  |- claims_m1_rstan.RDS
|  |- claims_m1_stanglm.RDS
|  |- claims_m2_stanglm.RDS
|  |- claims_m3_stanglm.RDS
|  |- claims_m4_stanglm.RDS
|  |- claims_m5_stanglm.RDS
|  |- claims_m6_stanglm.RDS
|  |- claims_m7_stanglm.RDS
|  |- claims_m8_stanglm.RDS
|  |- claims_m9_stanglm.RDS
|  |- claims_m10_stanglm.RDS
|  |- claims_m11_stanglm.RDS
|  |- claims_m12_stanglm.RDS
|  |- claims_m13_stanglm.RDS
|  |- claims_m14_stanglm.RDS
|  |- claims_m15_stanglm.RDS
|  |- claims_m16_stanglm.RDS
|  |- claims_nomult_hiviol_m1_stanglm.RDS
|  |- crises_m1_allothers_rstan.RDS
|  |- crises_m1_ingr23_rstan.RDS
|  |- crises_m1_mp3_rstan.RDS
|  |- crises_m1_noigos_rstan.RDS
|  |- crises_m1_pb_rstan.RDS
|  |- crises_m1_rstan.RDS
|  |- crises_m1_stanglm.RDS
|  |- crises_m2_stanglm.RDS
|  |- crises_m3_stanglm.RDS
|  |- crises_m4_stanglm.RDS
|  |- crises_m5_stanglm.RDS
|  |- crises_m6_stanglm.RDS
|  |- crises_m7_stanglm.RDS
|  |- crises_m8_stanglm.RDS
|  |- crises_m9_stanglm.RDS
|  |- crises_m10_stanglm.RDS
|  |- crises_m11_stanglm.RDS
|  |- crises_m12_stanglm.RDS
|  |- crises_m13_stanglm.RDS
|  |- crises_m14_stanglm.RDS
|  |- crises_m15_stanglm.RDS
|  |- crises_noclus_m1_stanglm.RDS
|  |- crises_nomult_hiviol_m1_stanglm.RDS 
|- Output_Tables-and-Figures/
|  |- [Tables and Figures will be generated here]
|- Sources:
|  |- atop3_0ddyr.dta
|  |- Dyadicdata.tab
|  |- icb1v11.csv
|  |- icbdy_v11.csv
|  |- ICOWclaimdy.dta
|  |- IGO_igounit_v2.3.narrow.csv
|  |- IGO_igounit_v2.3.short.csv
|  |- IGO_names_v2.3.csv
|  |- IGO_stateunit_v2.3.csv
|  |- igo.c1.diss.dta
|  |- igo.c2.diss.dta
|  |- igo.dyad.diss.dta
|  |- IGOpb_dyadunit.dta
|  |- igotrade.ud1918.dta
|  |- KGD_rivalry_yearly.dta
|  |- mtopsd150.dta
|  |- NMC_v4_0.c1.dta
|  |- NMC_v4_0.c2.dta
|  |- polityiv.c1.dta
|  |- polityiv.c2.dta
|  |- thompson.rivalry.yearly.dta
|  |- TM_WORLD_BORDERS_SIMPL-0.3/
|     |- Readme.txt
|     |- TM_WORLD_BORDERS_SIMPL-0.3.dbf
|     |- TM_WORLD_BORDERS_SIMPL-0.3.prj
|     |- TM_WORLD_BORDERS_SIMPL-0.3.shp
|     |- TM_WORLD_BORDERS_SIMPL-0.3.shx</code></pre>
<h1 id="software-information">Software information</h1>
<p>The <code>sessionInfo()</code> output below shows the versions of all R packages used in the analyses in this article.</p>
<pre><code>R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X El Capitan 10.11.6

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] ggrepel_0.6.5        maps_3.1.1           RColorBrewer_1.1-2   foreign_0.8-67      
 [5] rgdal_1.2-4          maptools_0.8-39      sp_1.2-3             pscl_1.4.9          
 [9] lattice_0.20-34      MASS_7.3-45          data.table_1.9.6     countrycode_0.18    
[13] caTools_1.17.1       ROCR_1.0-7           gplots_3.0.1         ggmcmc_1.1          
[17] tidyr_0.6.0          BMA_3.18.6           rrcov_1.3-11         inline_0.3.14       
[21] robustbase_0.92-6    leaps_2.9            survival_2.39-5      lme4_1.1-13         
[25] Matrix_1.2-7.1       loo_1.1.0            gridExtra_2.2.1      texreg_1.36.23      
[29] rstan_2.15.1         StanHeaders_2.15.0-1 reshape2_1.4.2       xtable_1.8-2        
[33] rstanarm_2.13.1      Rcpp_0.12.11         ggplot2_2.2.1        dplyr_0.5.0         
[37] rio_0.4.16          

loaded via a namespace (and not attached):
 [1] VGAM_1.0-2         minqa_1.2.4        colorspace_1.2-6   rsconnect_0.8     
 [5] markdown_0.8       base64enc_0.1-3    MatrixModels_0.4-1 urltools_1.6.0    
 [9] DT_0.2             mvtnorm_1.0-6      xml2_1.1.1         codetools_0.2-15  
[13] splines_3.3.2      shinythemes_1.1.1  bayesplot_1.2.0    Formula_1.2-1     
[17] jsonlite_1.5       nloptr_1.0.4       mcmc_0.9-4         pbkrtest_0.4-6    
[21] cluster_2.0.5      geepack_1.2-1      shiny_1.0.3        readr_1.0.0       
[25] assertthat_0.1     lazyeval_0.2.0     survey_3.30-3      htmltools_0.3.6   
[29] quantreg_5.26      tools_3.3.2        coda_0.19-1        gtable_0.2.0      
[33] cellranger_1.1.0   Amelia_1.7.4       gdata_2.17.0       nlme_3.1-128      
[37] lmtest_0.9-34      stringr_1.2.0      readODS_1.6.2      openxlsx_3.0.0    
[41] mime_0.5           miniUI_0.1.1       gtools_3.5.0       DEoptimR_1.0-8    
[45] zoo_1.8-0          scales_0.4.1       colourpicker_0.3   miscTools_0.6-16  
[49] parallel_3.3.2     sandwich_2.3-4     SparseM_1.7        shinystan_2.3.0   
[53] yaml_2.1.14        curl_2.3           triebeard_0.3.0    reshape_0.8.5     
[57] stringi_1.1.5      dygraphs_1.1.1.4   pcaPP_1.9-60       AER_1.2-4         
[61] gpclib_1.5-5       chron_2.3-47       matrixStats_0.52.2 bitops_1.0-6      
[65] rstantools_1.2.0   htmlwidgets_0.8    labeling_0.3       GGally_1.3.0      
[69] plyr_1.8.4         magrittr_1.5       R6_2.2.1           DBI_0.4-1         
[73] haven_1.0.0        mgcv_1.8-16        xts_0.9-7          nnet_7.3-12       
[77] tibble_1.2         csvy_0.1.3         car_2.1-2          KernSmooth_2.23-15
[81] maxLik_1.3-4       grid_3.3.2         readxl_0.1.1       threejs_0.2.2     
[85] digest_0.6.12      httpuv_1.3.3       Zelig_5.0-15       MCMCpack_1.3-6    
[89] MatchIt_2.4-21     stats4_3.3.2       munsell_0.4.3      shinyjs_0.9       </code></pre>
            </div>
    </div>
  </div>
  <script src="https://vjs.zencdn.net/5.4.4/video.js"></script>

</body>
</html>
